package cn.dengta.webapp.user.model;

import cn.dengta.common.model.ValueProxy;
import cn.dengta.context.model.LabelI18nProxy;
import cn.dengta.context.model.UserEnumI18nKey;
import lombok.Getter;

@Getter
public enum MaritalStatus implements LabelI18nProxy<MaritalStatus, Integer> {
	/** 单身 */
	SINGLE(0, UserEnumI18nKey.MARITAL_STATUS_SINGLE),
	/** 恋爱中 */
	IN_LOVE(1, UserEnumI18nKey.MARITAL_STATUS_IN_LOVE),
	/** 已婚 */
	MARRIED(2, UserEnumI18nKey.MARITAL_STATUS_MARRIED),
	/** 开放式 */
	OPEN_ENDED(3, UserEnumI18nKey.MARITAL_STATUS_OPEN_ENDED),
	/** 保密 */
	SECRECY(4, UserEnumI18nKey.MARITAL_STATUS_SECRECY);
	//

	// 定义私有变量
	public Integer value;
	final ValueProxy<MaritalStatus, Integer> proxy;

	// 构造函数，枚举类型只能为私有
	MaritalStatus(Integer value, String label) {
		this.value = value;
		this.proxy = new ValueProxy<>(this, value, label);
	}

	public static MaritalStatus[] getValues() {
		return ValueProxy.getCachedArray(MaritalStatus.class, MaritalStatus::values);
	}

	public static MaritalStatus of(Integer value) {
		return SINGLE.getValueOf(value);
	}
}
